<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 声明一个数组
        const arr = ['显示器','音响','键盘','麦克风','大台灯'];

        // 输出
        // 调用 Symbol.iterator 方法   返回指针对象
        let res = arr[Symbol.iterator]();
        console.log(res.next()); // {value: '显示器', done: false}
        console.log(res.next()); // {value: '音响', done: false}
        console.log(res.next()); // {value: '键盘', done: false}
        console.log(res.next()); // {value: '麦克风', done: false}
        console.log(res.next()); // {value: '大台灯', done: false}
        console.log(res.next()); // {value: undefined, done: true}

        //for ... of
    </script>
</body>
</html>